package com.macro.mall.util;

import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

public class CreateID {
    private static Random random = new Random();

    private CreateID() {

    }

    public static String createID() {
        return new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date())
                + new DecimalFormat("000").format(random.nextInt(100));
    }

    public static String createIDForUser() {
        SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
        String date = format.format(new Date());
        return date;
    }

    public static String createIDReq() {
        return new DecimalFormat("00000000").format(random.nextInt(99999999));
    }


}
